#include <stdio.h>
#include <sys/stat.h>
#include <stdlib.h>

int main(){
    struct stat* buf = (struct stat*)malloc(sizeof(struct stat));
    stat("..", buf);

    printf("file mode is %d\n", buf->st_mode);
    printf("file inode number is %ld\n", buf->st_ino);
    printf("device number is %ld\n", buf->st_dev);
    printf("device number for file is %ld\n", buf->st_rdev);
    printf("number of link is %ld\n", buf->st_nlink);
    printf("owner uid is %d\n", buf->st_uid);
    printf("owner gud is %d\n", buf->st_gid);
    printf("file size is %ld\n", buf->st_size);
    printf("best I/O block size is %ld\n", buf->st_blksize);
    printf("number of disk block allocated is %ld\n", buf->st_blocks);

    free(buf);
    return 0;
}